var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2KDefine = require("KDefine");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_StateComponent = /* */function (_cc$Component69) {
  babel_inherits(l, _cc$Component69);
  var _super85 = babel_createSuper(l);
  function l() {
    var _this197;
    babel_classCallCheck(this, l);
    _this197 = _super85.apply(this, arguments);
    _this197.state = $2KDefine.State.idle;
    _this197.stateMap = {
      idle() {}
    };
    return _this197;
  }
  babel_createClass(l, [{
    key: "setState",
    value: function setState(e) {
      var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
      t || cc.Tween.stopAllByTarget(this.node);
      this.state = e;
    }
  }, {
    key: "regState",
    value: function regState(e, t) {
      this.stateMap[e] = t;
    }
  }, {
    key: "updateFrame",
    value: function updateFrame(e) {
      this.stateMap[this.state].call(this, e);
    }
  }]);
  return l;
}(cc.Component);
def_StateComponent = cc__decorate([ccp_ccclass], def_StateComponent);
exports.default = def_StateComponent;